
@model DateTime?
@{
    if (ViewData.ContainsKey("class")) {
        ViewData["class"] = ViewData["class"] + " dateTimeEditorPicker";
    } else {
        ViewData.Add("class", "dateTimeEditorPicker");        
    }
}
@Html.TextBox("", (Model.HasValue ? String.Format("{0}", Model.Value.ToString("dd/MM/yyyy")) : string.Empty), ViewData)     

@*@model DateTime?

@Html.TextBox("", (Model.HasValue ? Model.Value.ToString("dd/MM/yyyy") : string.Empty), new { @class = "pickDate" })
<script type="text/javascript">
    $(document).ready(function () {

        $('.pickDate').datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat: 'dd-mm-yy'
        });
    });
</script>*@